package com.ft.oa.enums;

/**
 * 质保结果 0-已解决 1-解决中 2-未解决
 * liyansheng
 */
public enum WarrantyResult {

    RESOLVED(0,"已解决"),
    RESOLVING(1,"解决中"),
    RESOLVE(2,"未解决");

    //名称
    private String name;
    //编码
    private int code;
    //构造函数
    WarrantyResult(int code, String name){
        this.code = code;
        this.name = name;
    }

    /**
     * 获取名称
     * @param code
     * @return
     */
    public static String getByCode(int code) {
        for (WarrantyResult value : WarrantyResult.values()) {
            if (value.code == code) {
                return value.name;
            }
        }
        return "";
    }
}
